import java.lang.reflect.InvocationTargetException;
import java.lang.reflect.Method;
import java.util.Map;
import java.util.concurrent.Callable;

/**
 * @Author Linyh
 * @Description
 * @Date 2022/7/12 10:49
 **/

public class Study {
    public static void main(String[] args) throws ClassNotFoundException {
        //创建线程
        //方法1
        MyThread t1 = new MyThread();

    }

    private static void class类的加载() throws ClassNotFoundException {
        Class c1 = Class.forName("Study");
        System.out.println("-----------");

        Class c2 = Study.class;
        Class c3 = new Study().getClass();
        System.out.println(c1 == c2);
        System.out.println(c2 == c3);
    }

    private static void 破坏成员方法封装性() throws NoSuchMethodException, InvocationTargetException, IllegalAccessException {
        Class c = Study.class;
        Study study = new Study();
        Method m = c.getDeclaredMethod("doTest", String.class);
        m.setAccessible(true);
        m.invoke(study, "aaa", 100f);
    }


    private static class MyThread {

    }
}

//多线程
class B implements Callable<Integer> {
    private Integer i = 0;

    @Override
    public Integer call() throws Exception {//在子线程中执行的方法
        i++;
        Thread.sleep(5000);
        return i;
    }
}